﻿using System;
using System.Threading;
using TestClientsCommon;
using smp.RabbitMq;

namespace Requester1
{
    class Program
    {
        static void Main(string[] args)
        {
            var factory = new RabbitMqFactory();
            using (var requester = factory.CreateRequester("req1"))
            {
                var messageNumber = 0;
                while (true)
                {
                    messageNumber++;
                    var message = new RequestMessage1 {Name = "Requester1 - " + messageNumber};
                    Console.WriteLine("Requesting message : " + message.Name);
                    var response = requester.Request<RequestMessage1, Response1>(message);
                    Console.WriteLine("Recieved response : " + response.Message);
                    Console.WriteLine();
                    Thread.Sleep(1000);
                }
            }
        }
    }
}
